//
//  HZWPictureModel.m
//  开心一刻
//
//  Created by lanou on 16/4/7.
//  Copyright © 2016年 刘洋. All rights reserved.
//

#import "HZWPictureModel.h"

@implementation HZWPictureModel
-(void)setValue:(id)value forUndefinedKey:(NSString *)key{
    
}
+(NSArray *)creatPictureModel:(NSDictionary *)dic
{
    NSMutableArray * modelArray = [NSMutableArray array];
    NSMutableArray * userArray = [NSMutableArray array];
    NSMutableArray * atorArray = [NSMutableArray array];
    
    NSDictionary * dataDic = dic[@"data"];
    NSArray * dataArray = dataDic[@"data"];
    for (NSDictionary * BigDic in dataArray)
    {
        NSArray *commentsArray = BigDic[@"comments"];
        for (NSDictionary * commentsDic  in commentsArray)
        {
            HZWPictureModel * model =[[HZWPictureModel alloc]init];
            [model setValuesForKeysWithDictionary:commentsDic];
            [userArray addObject:model];
        }
        NSDictionary * groupDic = BigDic[@"group"];
        HZWPictureModel * model = [[HZWPictureModel alloc]init];
        [model setValuesForKeysWithDictionary:groupDic];
        NSDictionary * userDic = groupDic[@"user"];
        [model setValuesForKeysWithDictionary:userDic];
        NSLog(@"+++%@",model.name);
        [atorArray addObject:model];
        }
    
    [modelArray addObject:userArray];
    [modelArray addObject:atorArray];
    return modelArray;
}
@end
